package com.bsdk.install.device.gateway.v1.cmd;

/**
 * @ProjectName: com.hlslock.utils.lock
 * @Package: com.hlslock.utils.lock
 * @ClassName: ICmd
 * @Author: HansYoung
 * @Description: cmd
 * @Createtime: 2023/12/11 08:40
 * @Modifytime: 2023/12/14 20:44
 * @Version: 1.0
 * @Copyright: ©2006-2023 版权所有. 深圳豪力士
 */
public interface ICmd {
    public static final String VERSION = "V1.0.0";
    /**
     * 返回指令常量
     */
    public static final int STATUS_SUCCESS = 200; //请求正确，如开锁，下发各类指令

    public static final int STATUS_ERROR = 500; //指令错误
    //
    public static final byte  GW_CMD_MQTT_SET = 0x01;  //MQTT参数设置
    public static final byte  GW_CMD_MQTT_REQ = 0x02; //MQTT参数设置查询
    public static final byte  GW_CMD_FORMAT_REQ = 0x03; //格式化系统
    public static final byte GW_CMD_FTP_SET = 0x03; //FTP参数设置
    public static final byte GW_CMD_FTP_REQ = 0x04;  //FTP参数设置查询
    public static final byte GW_CMD_DOWN_START = 0x05;  //FTP开始升级
    public static final byte GW_CMD_RESET_GW = 0x06; //复位设备
    public static final byte GW_CMD_TIME_SET = 0x07;  //网关时间设置
    public static final byte GW_CMD_TIME_REQ = 0x08;  //网关时间设置查询
    public static final byte GW_CMD_DEVID_SET = 0x09;  //网关devid的设置
    public static final byte GW_CMD_DEVID_REQ = 0x0A; //网关devid的设置查询
    public static final byte GW_CMD_DEVICE_REG = 0x0B; //设备上报
    public static final byte GW_CMD_REQ_MAC = 0x0C; //查询网关MAC
    public static final byte GW_CMD_INTERNAL_SET = 0x0D; //网关发心跳包间隔设置
    public static final byte GW_CMD_INTERNAL_REQ = 0x0E; //网关发心跳包间隔设置查询
    public static final byte GW_CMD_INFO_REQ = 0x0F; //网关硬件信息查询
    public static final byte GW_CMD_NEW_START = 0x10;  //开始查询新设备
    public static final byte GW_CMD_REGED_REQ = 0x11; //查询已经入网设备
    public static final byte GW_CMD_EMPTY_REG = 0x12; // 清空入网设备
    public static final byte GW_CMD_ADD_MAC = 0x13; //添加入网设备
    public static final byte GW_CMD_DEL_MAC = 0x14; //删除入网设备
    public static final byte GW_CMD_SELF_MAC_REQ = 0x15; //网关自身MAC的查询

    public static final byte GW_CMD_NEW_STOP = 0x16; // 停止查询入网设备
    public static final byte GW_CMD_SCENE_SET = 0x17; // 情景模式定义
    public static final byte GW_CMD_SCENE_REQ = 0x18; // 情景模式查询
    public static final byte GW_CMD_SCENE_EXE = 0x19; // 情景模式执行
    public static final byte GW_CMD_SCENE_FORMAT = 0x1A; // 情景模式格式化
    public static final byte GW_CMD_SCENE_DELE = 0x1B; //删除某情景模式
    public static final byte GW_CMD_SSID_PWD_SET = 0x1C; //SSID,PWD
    public static final byte GW_CMD_SSID_PWD_REQ = 0x1D; //SSID,PWD
    public static final byte GW_CMD_AUTH_IP_PORT_SET = 0x1E; //AUTH IP PORT
    public static final byte GW_CMD_AUTH_IP_PORT_REQ = 0x1F; //AUTH IP PORT
    public static final byte GW_CMD_SET_GW_CHN = 0x20;
    public static final byte GW_CMD_GET_GW_CHN = 0x21;


    //模块的通讯协议
    public final int MOUDLE_CMD_RECEIVE_HEAD = 0x00;
    public final int MOUDLE_CMD_RECEIVE_LEN1 = 0x01;
    public final int MOUDLE_CMD_RECEIVE_LEN2 = 0x02;
    public final int MOUDLE_CMD_RECEIVE_CMD_DATA = 0x04;
    public final int MOUDLE_CMD_RECEIVE_CRC = 0x05;
    public final int MOUDLE_CMD_RECEIVE_TAIL = 0x06;
    public final int MOUDLE_CMD_RECEIVE_OK = 0x07;


    /**
     * 网关协议
     * @param byteData
     * @param len
     * @return
     */
    byte check_crc(byte[] ptr, int n);
    public  String pack_crc(byte[] data, int len);
}